﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace com.guysherman.simulclass
{
    public abstract class ScannedMember
    {
        public string ClassName { get; set; }
        public string Name { get; set; }
        public MemberTypes MemberKind { get; set; }
        public Type MemberType { get; set; }
        public MemberVisibility Visibility { get; set; }

        public abstract string MemberFunctionDeclaration();

        public abstract string MemberVariableDeclaration();

        public abstract string MemberFunctionDefinition();

        protected string nameDecoratorForVisibility(MemberVisibility memberVisibility)
        {
            switch (memberVisibility)
            {
                case MemberVisibility.Internal:
                    return "_internal_";
                case MemberVisibility.Protected:
                    return "_protected_";
                case MemberVisibility.Private:
                    return "_private_";
                case MemberVisibility.Public:
                default:
                    return string.Empty;
            }
        }

        protected string typeDecorator(Type memberType)
        {
            string typeDecorator = string.Empty;
            if (memberType.IsPrimitive)
            {
                typeDecorator = memberType.PrimitiveTypeName();
            }
            else
            {
                typeDecorator = "MonoObject*";
            }
            return typeDecorator;
        }
        
    }

}
